import React, { useEffect } from 'react';
import SubmitForm from '../SubmitForm';
import { lateralView, clearCanvas } from '@/utils/canvas';

function Chart6({ list = [], name, guide, patientId, onlyShowCanvas }) {
  useEffect(() => {
    const arr4 = [
      ['声音表达', 0, 5],
      ['语汇表达', 5, 7],
      ['简单句表达', 12, 5],
      ['复杂句表达', 17, 4],
      ['语言精熟度', 21, 4],
      ['非口语理解', 32, 3],
      ['语汇理解', 35, 7],
      ['简单句理解', 42, 4],
      ['复杂句理解', 46, 6],
      ['叙述性语言理解', 52, 3],
    ];
    clearCanvas('view7');
    lateralView(guide.code, 'view7', list, `领域五：${name}侧面图`, name, null, false, arr4);
  }, [list]);

  return (
    <>
      <canvas
        width="1200"
        height="600"
        style={{ margin: '30px 0', width: '100%', border: '1px solid #ddd' }}
        id="view7"
      />
      {!onlyShowCanvas && (
        <SubmitForm list={list} guide={guide} name={name} patientId={patientId} scaleType={4} />
      )}
    </>
  );
}
export default Chart6;
